# def cal_length(line):
# 	length = 0
# 	maxL = 0
# 	for item in line:
# 		if item == 1:
# 			length = length + 1
# 		if maxL < length:
# 			maxL = length
# 		if item == 0:
# 			length=0
# 	return maxL

# def setOne(line,index):
# 	tmp = line
# 	tmp[index]=1
# 	return tmp

# def unsetOne(line,index):
# 	tmp = line
# 	tmp[index]=0
# 	return tmp


# def find_best(line,times):
# 	length = len(line)
# 	tmp_times = times
# 	ll = line
# 	if times > 0:
# 		ll = find_best1(ll)
# 		return find_best(ll,tmp_times-1)
# 	else:
# 		return cal_length(ll)


# def find_best1(line):
# 	tmp_line = line
# 	best_length = 0
# 	best_line = []
# 	best_idx = 0
# 	for idx in range(len(line)):
# 		if line[idx] == 1:
# 			continue
# 		if line[idx] == 0:
# 			tmp_line = setOne(tmp_line,idx)
# 			if cal_length(tmp_line)>best_length:
# 				best_length = cal_length(tmp_line)
# 				best_idx = idx
# 				best_line = tmp_line
# 			tmp_line = unsetOne(tmp_line,idx)
# 	tmp_line = setOne(tmp_line,best_idx)
# 	return tmp_line




# N,K = [int(i) for i in input().strip().split(' ')]
# line = [int(i) for i in input().strip().split(' ')]
# print(find_best(line,K))

def check(N,searched):
	for i in range(N):
		flag = 0
		for item in searched:
			if item == i+1:
				flag = 1
				break
		if flag == 1:
			continue
		else:
			return 0
	return 1

def searchNext(dic,startPoint):
	nextPoint = []
	for item in dic:
		if startPoint == item[0]:
			nextPoint.append(item[1])
			continue
		if startPoint == item[1]:
			nextPoint.append(item[0])
			continue	
	return nextPoint
	
N = int(input().strip())
# dic = []
# for line in range(len(N)):
# 	dic.append([int(i) for i in input().strip().split(' ')])

line_search = []
searched = []
print(check(N,[1,2,3]))
while check(N,searched)>0:







# m = int(raw_input().strip())
# a = raw_input().strip().split(' ')
# # (a.sort()).reverse()
# a = [float(i) for i in a]
# a.sort()
# a.reverse()
# cow = 0
# sheep = 0
# idx = 0
# while idx<m:
# 	if idx % 2 == 0:
# 		cow = cow + a[idx]
# 	else:
# 		sheep = sheep + a[idx]
# 	idx = idx +1
# print cow-sheep
